# -*- coding:utf-8 -*-
#! python3
from facecat import *

gPaint = FCPaint() #创建绘图对象

#消息循环
def WndProc(hwnd,msg,wParam,lParam):
	return WndProcDefault(gPaint,hwnd,msg,wParam,lParam)

#初始化窗体
createMainWindow(gPaint, "facecat-py", WndProc)
current_file_path = os.path.abspath(__file__)
current_file_dir = os.path.dirname(current_file_path)
file0 = open(current_file_dir + "\\xml\\layoutdivexample.xml", encoding="UTF-8")
xml = file0.read()
file0.close()
renderFaceCat(gPaint, xml)
tabPage = findViewByName("TabPage2", gPaint.views)
layoutDiv = FCLayoutDiv()
layoutDiv.location = FCPoint(50, 50)
layoutDiv.size = FCSize(250, 100)
layoutDiv.showHScrollBar = True
addViewToParent(layoutDiv, tabPage)
for i in range(0,10):
    button = FCButton()
    location = FCPoint(0, 0)
    button.size = FCSize(100, 40)
    addViewToParent(button, layoutDiv)
    button.text = "Button"
resetLayoutDiv(layoutDiv)
showWindow(gPaint)